<h2>Chatbox</h2>
<?php echo $this->Paginator->prev('< Poprzednia', null, null, array('class' => 'disabled')); ?>
&nbsp;&nbsp;
<?php echo $this->Paginator->numbers(); ?>
&nbsp;&nbsp;
<?php echo $this->Paginator->next('Następna >', null, null, array('class' => 'disabled')); ?>

<table>
    <thead>
        <tr>
            <th>Id</th>
            <th>Autor</th>
            <th>Treść</th>
            <th>Czas</th>
            <th>Akcje</th>
        </tr>
    </thead>
    <tbody>
        <?php
        foreach ($data as $message) {
            echo("<tr><td>" . $message['ChatboxMessage']['id'] . "</td><td>" . $message['ChatboxMessage']['nickname'] . "</td>");
            echo("<td>" . $this->Emoticons->emoticonize($message['ChatboxMessage']['content']) . "</td><td>" . date("d.m.Y H:i:s", $message['ChatboxMessage']['timestamp']) . "</td>");
            echo("<td>");
            echo $this->Html->link(
                    'Usuń',
                    array('controller' => 'chatbox', 'action' => 'admin_delete', $message['ChatboxMessage']['id']),
                    array(),
                    "Jesteś pewien, że chcesz usunąć tą wiadomość?"
            );
            echo("</td>");
            echo("</tr>");
        }
        ?>
    </tbody>
</table>
<?php echo $this->Paginator->prev('< Poprzednia', null, null, array('class' => 'disabled')); ?>
&nbsp;&nbsp;
<?php echo $this->Paginator->numbers(); ?>
&nbsp;&nbsp;
<?php echo $this->Paginator->next('Następna >', null, null, array('class' => 'disabled')); ?>
